<?php
define("CORE_APP_REAL_PATH", dirname(__FILE__) . "/../../../");
define("CORE_LIB_PATH", CORE_APP_REAL_PATH . "src/lib");
define("CORE_LIB_PROPEL_PATH", CORE_APP_REAL_PATH . "src/lib/propel/runtime/classes");
define("CORE_LIB_PHING_PATH", CORE_APP_REAL_PATH . "src/lib/phing/classes");
define("CORE_CLASS_PATH", CORE_APP_REAL_PATH . "src/main/classes");
define("CORE_RESOURCE_PATH", CORE_APP_REAL_PATH . "src/main/resources");
define("CORE_SRC_PATH", CORE_APP_REAL_PATH . "src");

define("INCLUDE_PATH", 
	CORE_APP_REAL_PATH . PATH_SEPARATOR . 
	CORE_SRC_PATH . PATH_SEPARATOR . 
	CORE_LIB_PATH . PATH_SEPARATOR .
	CORE_LIB_PROPEL_PATH . PATH_SEPARATOR .
	CORE_LIB_PATH . "/propel/generator" . PATH_SEPARATOR .	
	CORE_LIB_PHING_PATH . PATH_SEPARATOR .
	CORE_CLASS_PATH . PATH_SEPARATOR . 
	CORE_RESOURCE_PATH);

set_include_path(INCLUDE_PATH);

// Also include the path of an external application. 
if (defined ("MAIN_APP_REAL_PATH")  ) {
	define("MAIN_LIB_PATH", MAIN_APP_REAL_PATH . "/src/lib");
	define("MAIN_CLASS_PATH", MAIN_APP_REAL_PATH . "/src/main/classes");
	define("MAIN_RESOURCE_PATH", MAIN_APP_REAL_PATH . "/src/main/resources");
	define("MAIN_SRC_PATH", MAIN_APP_REAL_PATH . "/src");
	
	define("MAIN_INCLUDE_PATH", 
		MAIN_APP_REAL_PATH . PATH_SEPARATOR . 
		MAIN_SRC_PATH . PATH_SEPARATOR . 
		MAIN_LIB_PATH . PATH_SEPARATOR . 
		MAIN_CLASS_PATH . PATH_SEPARATOR . 
		MAIN_RESOURCE_PATH);
	
	set_include_path(get_include_path() . PATH_SEPARATOR . MAIN_INCLUDE_PATH);
}
